<template>
	<view>
		<view class="camera-title-container">
			<text class="camera-title">摄像头画面</text>
			<image class="control-image" src="../../static/images/shexiangtou.png"></image>
		</view>
		<view class="camera-image-container">
			<image v-if="sharedState.imageSrc" :src="sharedState.imageSrc" mode="aspectFit" class="camera-image"></image>
		</view>
	</view>
</template>

<script>
	
	import { inject } from 'vue';
	
	export default {
	setup() {
		const sharedState = inject('sharedState'); // 注入共享状态
		return { sharedState };
	}
	};
</script>

<style>
	.camera-title-container {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px; /* 标题和图标之间的间距 */
		margin-bottom: 20px;
	}

	.camera-title {
		font-size: 20px;
	}

	.control-image {
		width: 27px;
		height: 27px;
	}

	.camera-image-container {
		border: 2px solid #ddd;
		border-radius: 10px;
		padding: 10px;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #f9f9f9;
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	}

	.camera-image {
		width: 300px;
		height: 300px;
		object-fit: cover;
	}
</style>